// import { uploadUrl } from "../resource/https";
// import { formatDate } from "../../assets/resource/filter";
// import pinyin from 'js-pinyin';
// import  { getAdmin } from '@A/resource/admin';
let publicMixins = {
  data() {
    return {
      page: 1,
      popup: false, // 控制弹窗
      loading: false,
      infoData: '',
      finished: false, // 无限加载 是否加载完成
    }
  },
  mounted() {
  },
  methods: {
    // 返回
    returnBtn(key){
      if(key == '1'){
        return false
      }
      if (window.history.length <= 1) {
        this.$router.push({path:'/'});
        return false
      } else {
        this.$router.go(-1);
      }
    },
    returnHome(){
      this.$router.push({path:'/user-info'});
    },
    promptBtn(val,key){
      if(val == '1'){
        alert(key); // 普通提示
      }
      if(val == '2'){
        // Toast.success(key); // 成功提示
      }
      if(val == '3'){
        // Toast.fail(key); // 失败提示
      }
    },
    // 退出
    exitBtn(){
      // on confirm
      window.localStorage.clear();
      this.$router.push({path:'/'});
    }
  },
  watch:{
    // 加载loading最多默认时长隐藏
    "loading"(){
      if(this.loading){
        setTimeout(() => {
          this.loading = false;
        }, 10000);
      }
    }
  }
};
export default publicMixins
